<% tabs = [{:label => 'summary', :template => 'summary', :selected => true}]
   if @design
     page_title_opts = {:page_icon     => platform_image_url(@platform),
                        :page_kind     => 'Platform',
                        :page_label    => @platform.ciName,
                        :doc_link      => platform_pack_link(@platform) +
                                          platform_doc_link(@platform, icon('book'), :anchor => 'design'),
                        :page_sublabel => @platform.ciAttributes.description}

     crumbs = [{:label => icon(site_icon(:design), 'designs'), :link => catalog_path(:anchor => 'designs')}]
     crumbs << {:label => @design.ciName, :kind => 'design', :link => catalog_design_path(@design)}

     tabs << {:label => 'variables', :url => catalog_design_platform_variables_path(@design, @platform)}
   else
     source       = params[:source]
     pack_name    = params[:pack]
     version      = params[:version]
     availability = params[:availability]
     if availability.blank?
       doc_anchor = 'design'
       bc_label   = icon(site_icon('design'), 'design')
     else
       doc_anchor = 'transition'
       bc_label   = icon(availability == 'redundant' ? 'cubes' : 'cube', "#{availability} availability")
     end
     page_title_opts = {:page_icon      => platform_image_url(@platform),
                        :page_kind      => 'Platform Pack',
                        :page_label     => "#{pack_name} #{content_tag(:sub, content_tag(:span, "ver. #{version}", :class => "label #{pack_version_label_class(@version,)}"))} #{content_tag(:sub, content_tag(:small, bc_label))}",
                        :page_label_url => catalog_pack_platform_path(source, pack_name, version, availability, pack_name),
                        :doc_link       => platform_doc_link(@platform, icon('book'), :anchor => doc_anchor),
                        :page_sublabel  => @platform.ciAttributes.description}

     crumbs = [{:label => icon(site_icon(:pack), 'packs'),
                :link => catalog_path(:anchor => 'packs')},
               {:kind  => 'source',
                :label => @platform.ciAttributes.source}]

     tabs << {:label => 'variables', :url => catalog_pack_platform_variables_path(:platform_id => @platform.ciId)}
     tabs << {:label => 'policies',  :url => catalog_pack_platform_policies_path(:platform_id => @platform.ciId)}
     tabs << {:label => 'diff',      :url => diff_catalog_pack_platforms_path(source, pack_name, version, availability)} if version.include?('.')
   end %>

<%= organization_page_header('catalogs') %>
<%= breadcrumb crumbs %>
<%= page_title page_title_opts %>
<%= render 'catalog/packs/pack_page_info' %>

<%= render 'base/shared/page_nav_pages', :items => tabs %>
